package com.jp.knowledge.adapter;

import android.content.Context;
import android.widget.TextView;

import com.jp.knowledge.R;
import com.jp.knowledge.model.HeadLine;

import java.util.List;

/**
 * Created by jiayen on 17/6/1.
 */

public class HeadLineDialogAdapter extends JpBaseRecyViewAdapter{
    public HeadLineDialogAdapter(Context context, List<HeadLine> infos) {
        super(context, infos);
    }



    @Override
    public int getLayoutId() {
         return R.layout.head_dialog_layout;
    }

    @Override
    public void bindViewHold(JPRecycleViewHolder holder, int position) {
        HeadLine item = (HeadLine) getItem(position);
        TextView textView = holder.getView(R.id.name);
        textView.setText(item.getTypeName());
        if(item.isCheck()){
            textView.setBackgroundResource(R.drawable.btn_blue);
            textView.setTextColor(mContext.getResources().getColor(R.color.white));
        }else {
            textView.setBackgroundResource(R.drawable.btn_rbg_gray);
            textView.setTextColor(mContext.getResources().getColor(R.color.font_black));
        }
    }
}
